// import 'package:flutter/material.dart';
// import './page/compose_view_1500_page.dart';
// import './page/List.dart';
// import './page/compose_view_1500_text.dart';
// import './page/compose_view_1500_text_lazy.dart';
// import './page/page.dart';
// import './page/NestedLayerInputPage.dart';
// // import 'dart:developer';

// void main() {
//   runApp(const MyApp());
// }

// class MyApp extends StatelessWidget {
//   const MyApp({super.key});

//   @override
//   Widget build(BuildContext context) {
//     return MaterialApp(
//       title: 'Flutter Demo',
//       theme: ThemeData(
//         primarySwatch: Colors.blue,
//       ),
//       home: const MyHomePage(title: 'Flutter Demo Home Page'),
//     );
//   }
// }

// class MyHomePage extends StatelessWidget {
//   const MyHomePage({super.key, required this.title});

//   final String title;

//   @override
//   Widget build(BuildContext context) {
//     return Scaffold(
//       appBar: AppBar(
//         title: Text(title),
//       ),
//       body: Center(
//         child: Column(
//           mainAxisAlignment: MainAxisAlignment.center,
//           children: [
//             ElevatedButton(
//               onPressed: () {
//                 Navigator.of(context).push(
//                   MaterialPageRoute(
//                     builder: (_) => const ComposeView1500LazyPage(),
//                   ),
//                 );
//               },
//               child: const Text('ComposeLazyView1500Page'),
//             ),
//             ElevatedButton(
//               onPressed: () {
//                 Navigator.of(context).push(
//                   MaterialPageRoute(
//                     builder: (_) => const ComposeView1500Page(),
//                   ),
//                 );
//               },
//               child: const Text('ComposeView1500Page'),
//             ),
//             ElevatedButton(
//               onPressed: () {
//                 // Timeline.startSync("NavigateToComposeView1500Text"); 
//                 Navigator.of(context).push(
//                   MaterialPageRoute(
//                     builder: (_) => const AutoScrollingInfiniteList(),
//                   ),
//                 );
//               },
//               child: const Text('AutoScrollingInfiniteList'),
//             ),
//             ElevatedButton(
//               onPressed: () {
//                 // Timeline.startSync("NavigateToComposeView1500Text"); 
//                 Navigator.of(context).push(
//                   MaterialPageRoute(
//                     builder: (_) => const  NestedLayerInputPage(),
//                   ),
//                 );
//               },
//               child: const Text('NestedLayer'),
//             ),
//           ],
//         ),
//       ),
//     );
//   }
// }

import 'package:flutter/material.dart';
import './page/compose_view_1500_page.dart';
import './page/List.dart';
import './page/compose_view_1500_text.dart';
import './page/compose_view_1500_text_lazy.dart';
import './page/page.dart';
import './page/NestedLayerInputPage.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

/// 无动画跳转工具：进入/返回都无动画
void pushNoAnim(BuildContext context, Widget page) {
  Navigator.of(context).push(
    PageRouteBuilder(
      pageBuilder: (_, __, ___) => page,
      transitionDuration: Duration.zero,
      reverseTransitionDuration: Duration.zero,
    ),
  );
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(title)),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () {
                pushNoAnim(context, const ComposeView1500LazyPage());
              },
              child: const Text('ComposeLazyView1500Page'),
            ),
            ElevatedButton(
              onPressed: () {
                pushNoAnim(context, const ComposeView1500Page());
              },
              child: const Text('ComposeView1500Page'),
            ),
            ElevatedButton(
              onPressed: () {
                pushNoAnim(context, const AutoScrollingInfiniteList());
              },
              child: const Text('AutoScrollingInfiniteList'),
            ),
            ElevatedButton(
              onPressed: () {
                pushNoAnim(context, const NestedLayerInputPage());
              },
              child: const Text('NestedLayer'),
            ),
          ],
        ),
      ),
    );
  }
}

